Examples of interactive chart visualization using Plotly.
[PT-BR content]
from plotly import __version__
from plotly.subplots import make_subplots
from plotly.graph_objs import *
print(__version__)
4.8.2
import numpy as np
# Dados para linha
N = 8
t = np.linspace(0, 1, N)
linA = Scatter(
x=t, y=t, name='linear',
mode='lines+markers',
marker={'symbol': 'circle', 'size': 7},
showlegend=False
)
linB = Scatter(
x=t, y=t, name='linear',
mode='lines+markers',
line={'dash': 'dash'},
marker={'symbol': 'star', 'size': 10},
showlegend=False
)
quad = Scatter(
x=t, y=t**2, name='quadrática',
mode='lines+markers',
line={'dash': 'dashdot'},
marker={'symbol': 'square', 'size': 7},
showlegend=False
)
cubi = Scatter(
x=t, y=t**3, name='cúbica',
mode='lines+markers',
line={'dash': 'dot'},
marker={'symbol': 'triangle-up', 'size': 10},
showlegend=False
)
%%time
fig = make_subplots(
rows=1, cols=2, print_grid=False,
subplot_titles=['Linha', 'Linhas']
)
fig.append_trace(linA, 1, 1)
fig.append_trace(linB, 1, 2)
fig.append_trace(quad, 1, 2)
fig.append_trace(cubi, 1, 2)
fig.show()